//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package objects;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;

public class Animals {
    private static final LinkedHashMap<Integer, AnimalEntry> animalsById = new LinkedHashMap();
    private static final LinkedHashMap<String, AnimalEntry> animalsByName = new LinkedHashMap();
    private static final LinkedHashMap<String, AnimalEntry> animalsByFeed = new LinkedHashMap();

    public Animals() {
    }

    public static void createAnimalEntry(String Name, Integer UnlockLevel, String Feed, String Good) {
        AnimalEntry ae = new AnimalEntry(Name, UnlockLevel, Integer.valueOf(animalsById.size()), Feed, Good);
        animalsById.put(ae.getGlobalID(), ae);
        animalsByName.put(ae.getName(), ae);
        animalsByFeed.put(ae.getFeed(), ae);
    }

    public static AnimalEntry getById(Integer id) {
        return (AnimalEntry)animalsById.get(id);
    }

    public static AnimalEntry getByName(String name) {
        return (AnimalEntry)animalsByName.get(name);
    }

    public static AnimalEntry getByFeed(String feed) {
        return (AnimalEntry)animalsByFeed.get(feed);
    }

    public static void clear() {
        animalsById.clear();
        animalsByName.clear();
        animalsByFeed.clear();
    }

    public static AnimalEntry getByGood(String good) {
        Iterator var2 = animalsById.values().iterator();

        while(var2.hasNext()) {
            AnimalEntry ae = (AnimalEntry)var2.next();
            if(good.equals(ae.getGood())) {
                return ae;
            }
        }

        return null;
    }

    public static Collection<AnimalEntry> get() {
        return animalsById.values();
    }
}
